tonykang22 / hello-world-auto-store

3 stars 1 forks source link

[common] 리소스 비용 최적화 #237

Open tonykang22 opened 1 year ago

tonykang22 commented 1 year ago

리소스 비용 최적화

개요



변경 사항


파파고 API

image image




{
  "productName": "Bandai Hobby 피겨 라이즈 표준 복면라이더 쿠우가 마이티 폼",
  "description": "개요헤이세이 시대 최초의 가면라이더가 피겨 라이즈 스탠다드 라인에 합류합니다! 쿠가의 마이티 폼은 마이티 킥과 상징적인 엄지손가락 업 포즈와 같은 시그니처 포즈와 동작을 재현하도록 설계된 다양한 컬러 몰딩 파트와 함께 모델 키트 형태로 화려하게 재창조되었습니다! 킥을 위한 불꽃 효과, 다양한 손동작 부품 및 디스플레이 스탠드를 포함합니다.상품 상세 정보 대략 상품 크기: 5.91\"",
  "searchKeyword": "Masked Rider Gits",
  "featureBullets": [
    "헤이세이 시대 최초의 가면라이더가 피겨 라이즈 스탠다드 라인에 합류한다",
    "쿠가의 강력한 형태는 다양한 색상의 성형 부품으로 모델 키트 형태로 훌륭하게 재현됩니다",
    "킥을 위한 불꽃 효과, 다양한 손동작 부품 및 디스플레이 스탠드를 포함합니다.",
    "제품에는 공식 Bluefin 로고가 있습니다"
  ],
  "keywordsList": [
    "장난감피규어플레이세트",
    "라이더",
    "쿠우가",
    "액션피규어",
    "그림 상승",
    "가면을 쓴",
    "형태",
    "힘센",
    "표준.",
    "장난감게임"
  ],
  "brand": "Bandai Hobby",
  "videos": [],
  "categories": [
    {
      "name": "장난감 & 게임",
      "link": "https://www.amazon.com/toys/b/ref=dp_bc_aui_C_1?ie=UTF8&node=165793011",
      "categoryId": "165793011"
    },
    {
      "name": "장난감 피규어 & 플레이 세트",
      "link": "https://www.amazon.com/kids-toys-action-figures-accessories/b/ref=dp_bc_aui_C_2?ie=UTF8&node=165993011",
      "categoryId": "165993011"
    },
    {
      "name": "액션 피규어",
      "link": "https://www.amazon.com/Action-Toy-Figures/b/ref=dp_bc_aui_C_3?ie=UTF8&node=2514571011",
      "categoryId": "2514571011"
    }
  ],
  "documents": [],
  "detailedDescriptionPage": null,
  "variants": [
    {
      "asin": "B07ZTFTDPR",
      "title": "피겨 라이즈 표준 복면라이더 쿠우가 마이티 폼",
      "buyboxWinner": {
        "offerId": "l3+5lQw2CJkHsxKqTSdTrEt5ZpGl8q0UYEobm6vd+ptuTUOmDyrpJSftV5kxJdqkYwilX5mH59+wB8J9pmK8NCQhcZEXWih9S9V2H8xDF2q1ns5xPYN3OECWc6nUQNtaaQLJQ6j/QqvjYeIMlxyNiSLnZKndOUA1nnchZPapJY2NmPFeq07yfQ==",
        "availability": {
          "type": "in_stock",
          "raw": "Only 12 left in stock - order soon"
        },
        "unqualifiedBuyBox": false,
        "price": {
          "symbol": "$",
          "value": 46.8,
          "currency": "USD",
          "raw": "$46.80"
        },
        "shipping": {
          "raw": "FREE",
          "value": null
        }
      },
      "link": "https://www.amazon.com/Figure-Rise-Standard-Masked-Rider-Mighty/dp/B07ZTFTDPR",
      "weight": 10.6,
      "dimensions": [
        2,
        5,
        6
      ],
      "shippingWeight": null,
      "mainImage": "https://m.media-amazon.com/images/I/61WLh1JHkKL.jpg",
      "images": [
        "https://m.media-amazon.com/images/I/61WLh1JHkKL._AC_SL1356_.jpg",
        "https://m.media-amazon.com/images/I/61OQA-LZr6L._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71cIS2A6tzL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/712l878O5kL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/61y8J1cxgQL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/61Ow7ht5LxL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/6156lK9Oq+L._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71eTkVxRb1L._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71WvnmwU47L._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71wobA1fnvL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71FPcEoe82L._AC_SL1500_.jpg"
      ],
      "rating": 4.6,
      "attributes": {},
      "specifications": {
        "제품 치수": "2 x 5 x 6 인치",
        "항목 무게": "10.6온스",
        "죄악": "B07ZTFTPR",
        "품번": "BAS5059022",
        "제조자추천연령": "13세 이상",
        "베스트셀러 순위": "장난감 & 게임에서 #299,622위",
        "고객 리뷰": "별 5개 중 4.6개 중 4.6개 381개 등급 별 5개 중 4.6",
        "제조자": "반다이",
        "처음 사용 가능한 날짜": "2019년 11월 16일"
      },
      "deliveryPrice": 26.6,
      "availability": 12,
      "price": 46.8,
      "itemId": "B07ZTFTDPR",
      "externalVendorSku": "AMAZON_US:B07ZTFTDPR"
    }
  ],
  "sourcingVendor": "AMAZON_US",
  "items": [
    {
      "asin": "B07ZTFTDPR",
      "title": "피겨 라이즈 표준 복면라이더 쿠우가 마이티 폼",
      "buyboxWinner": {
        "offerId": "l3+5lQw2CJkHsxKqTSdTrEt5ZpGl8q0UYEobm6vd+ptuTUOmDyrpJSftV5kxJdqkYwilX5mH59+wB8J9pmK8NCQhcZEXWih9S9V2H8xDF2q1ns5xPYN3OECWc6nUQNtaaQLJQ6j/QqvjYeIMlxyNiSLnZKndOUA1nnchZPapJY2NmPFeq07yfQ==",
        "availability": {
          "type": "in_stock",
          "raw": "Only 12 left in stock - order soon"
        },
        "unqualifiedBuyBox": false,
        "price": {
          "symbol": "$",
          "value": 46.8,
          "currency": "USD",
          "raw": "$46.80"
        },
        "shipping": {
          "raw": "FREE",
          "value": null
        }
      },
      "link": "https://www.amazon.com/Figure-Rise-Standard-Masked-Rider-Mighty/dp/B07ZTFTDPR",
      "weight": 10.6,
      "dimensions": [
        2,
        5,
        6
      ],
      "shippingWeight": null,
      "mainImage": "https://m.media-amazon.com/images/I/61WLh1JHkKL.jpg",
      "images": [
        "https://m.media-amazon.com/images/I/61WLh1JHkKL._AC_SL1356_.jpg",
        "https://m.media-amazon.com/images/I/61OQA-LZr6L._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71cIS2A6tzL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/712l878O5kL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/61y8J1cxgQL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/61Ow7ht5LxL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/6156lK9Oq+L._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71eTkVxRb1L._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71WvnmwU47L._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71wobA1fnvL._AC_SL1500_.jpg",
        "https://m.media-amazon.com/images/I/71FPcEoe82L._AC_SL1500_.jpg"
      ],
      "rating": 4.6,
      "attributes": {},
      "specifications": {
        "제품 치수": "2 x 5 x 6 인치",
        "항목 무게": "10.6온스",
        "죄악": "B07ZTFTPR",
        "품번": "BAS5059022",
        "제조자추천연령": "13세 이상",
        "베스트셀러 순위": "장난감 & 게임에서 #299,622위",
        "고객 리뷰": "별 5개 중 4.6개 중 4.6개 381개 등급 별 5개 중 4.6",
        "제조자": "반다이",
        "처음 사용 가능한 날짜": "2019년 11월 16일"
      },
      "deliveryPrice": 26.6,
      "availability": 12,
      "price": 46.8,
      "itemId": "B07ZTFTDPR",
      "externalVendorSku": "AMAZON_US:B07ZTFTDPR"
    }
  ]
}




Cloud IoT Core


image image image




DB 클러스터


image image

CloudDB for MySQL 사용 시


image

MySQL 사용 시




CloudFunctions


image




Server Spec



백업 목록

DB


Cloud Functions

L7 check

import requests

def main(args):
    host_ip = "CLASSIFIED"
    module_port = [8000, 8001, 8002, 8003]
    module = ["product-analyzer", "product-manager", "order-manager", "cs-manager"]

    for i in range(4):
        try:
            message = '{\"text": "L7 check failed. Check module [' + module[i] + ":" + str(module_port[i]) + "]\"}"

            url = f"http://{host_ip}:{module_port[i]}/{module[i]}/monitor/l7check"
            response = requests.get(url, timeout=5)
            if response.status_code != 200:
                requests.post("https://hooks.slack.com/services/CLASSIFIED",message)
        except Exception as e:
            print(e)
            requests.post("https://hooks.slack.com/services/CLASSIFIED",message)
    return {"action": "activated"}
tonykang22 commented 1 year ago

결론

필요 리소스