Commit dffc31e6 authored by frank.chen's avatar frank.chen

fff

parent 8e3656c6
## 概述
- 暂时用 md 文本,以后可能用流程图。
- 我们使用了 cdn 保存 apk,下载地址下发后,一段时间会超时。
- 超时后,需要调用接口,重新获取 apk 的 cdn 下载地址。
## 逻辑
- 某些 dsp 可以直接使用 dsp 的 apk url,代码中用 UsingDspPkg 标记。
- 联盟的流量,根据机型可伪装成三星商店的流量,转给 dsp,代码中用 Cloak 标记。
- 广告位 和 pkg,配置了 某些情况下,只能用 dsp 的包。
- 读取配置:摇塞子决定使用 dsp 的包,还是 cdn 的包。
-
\ No newline at end of file
......@@ -5,7 +5,7 @@
## 格式
| 字段 | 说明 | 例子 |
| ------------- | ------- | --------------------------------- |
| ------------- | ------------ | ---------------------------------- |
| type | 日志类型 | ascribe 或 third_track amend_click |
| httpcode | http状态码 | 200 |
| status | 是否成功 | 1或0 |
......
## redis 地址
- prd
```
ADX_REDIS_ADDRESS ("redis.rubmzgfdnfoi.scs.bj.baidubce.com");
SSP_REDIS_ADDRESS ("redis.gvsdcennvpny.scs.bj.baidubce.com");
CLUSTER_REDIS_ADDRESS ("redis.iooiirmcjbap.scs.bj.baidubce.com");
CLUSTER2_REDIS_ADDRESS ("redis.pdghwriucukg.scs.bj.baidubce.com");
CLUSTER3_REDIS_ADDRESS ("redis.trgmrptmzmwg.scs.bj.baidubce.com");
CACHELOG_REDIS_ADDRESS ("redis.higzkyksnfkv.scs.bj.baidubce.com");
USER_APPS_REDIS_ADDRESS("redis.cxpputczptip.scs.bj.baidubce.com")
```
- stg
```
其他共用 redis.porqbbjumgcs.scs.bj.baidubce.com
USER_APPS_REDIS_ADDRESS("redis.cxpputczptip.scs.bj.baidubce.com")
```
## key
### ssp redis
- `adreq_monitor_[ip地址]`
- 写入
- 自己使用
- 记录单台服务器接收到的请求数
- SerFuncConf
- 写入
- 自己使用
- 记录服务器状态。
- ssp:sensitives
- 读取
- 搜索时,敏感词判断
- ssp:page_info
- 读取
- 获取广告位的page信息,经过查看代码,目前似乎不在使用。
- ssp:ctr:keywords
- 读取
- 由 IntimeStat python 脚本生成
- ssp:recomend:adpos_categories
- 读取
- 经过查看 redis 发现这里一直无值。
- baidu_pkgs iflytek_pkgs iqiyi_pkgs kuaishou_pkgs oppo_pkgs pangolin_pkgs ylh_pkgs
- 上面多个key
- 写入
- 缓存广告信息,当 dsp 的包不在我们库里时。由张旭那边读取
- ssp:dmp:flow_rule
- 读取
- 预测时的分流规则:头条,zzy 的占比
- media:tencent:business:key
- 读取
- 应用宝的 business key
- ssp:adpos_info
- 读取
- 广告位信息
- ssp:adpos_info_ex
- 读取
- 广告位信息,加强版。
- `PKG:APID_[pkg]`
- 读取
- 包拥有哪些 appid
- ssp:app:filter:installed
- 读取
- 是否需要过滤已安装
- rta_app
- 读取
- 需要执行 rta 的 app id
- ssp:search:appname:filter
- 读取
- 未被使用,作用未知。
- ssp:app_info
- 读取
- app 信息
- app_pkg_name
- 读取
- 包名获取应用名
- defeat_apps
- 读取
- 投放时,根据价格做优化。
- dsp:info
- 读取
- dsp 配置信息
- ssp:dsp:flow_rule
- 读取
- dsp 分流规则
- INTIME_STAT_ALL
- 读取
- 实时 ctr
- 由 IntimeStat python 脚本生成
- keyword:union
- 读取
- app 设置的关联关键词
- ssp:strategy_app_keywords_adpos
- 读取
- 广告位设置了关键字app白名单
- map_api_level_2_android_ver
- 读取
- app ver 对应的 安卓版本
- ssp:strategy:yingyongbao
- 读取
- 应用宝的活动
- ssp:strategy:ascribe
- 读取
- 需要归因的活动
- tt_competing_app
- 读取
- 头条广告的竞品 app
- rewards:user:apps
- 读取
- 星钻相关的已安装app
- dsp:return:ad
- 写入
- 当dsp有广告返回时,记录我们的媒体流量的url
- 个人自己使用
- pos:return:ad
- 写入
- 媒体请求某个广告位时,若返回了广告,则缓存最后的url
- 个人自己使用
- `pos:put:ad_[日期]`
- 例如:pos:put:ad_2024-7-1-16
- 写入
- 广告位匹配了多少次某个活动
- 个人自己使用
- `rta_[日期]`
- 例如:rta_2024-07-01_16_1
- 写入
- 统计rta次数
### adx redis
- `dsprecord_[时间]`
- key 例子:dsprecord_2024-07-01_16_3
- 写入
- 统计 dsp 返回广告。
### cachelog redis
- dsp:notify
- 写入
- dsp win loss 通知
- adx:dsp-log
- 写入
- dsp 匹配日志,由 adx-cron 拉取,并落盘。
- `nbr_ssp_[日期]`
- 例如:nbr_ssp_2024-6-6-10_20
- 写入
- 广告匹配的 nbr 信息
### userApps redis
- `userapps:[uid]`
- 读取
- 用户已安装app
### cluster redis
- `SSP:UID:OAID:[uid]`
- 写入
- 缓存 oaid,归因相关
### cluster2 redis
- `InTime_INST_APP_[uid]`
- 读取
- 用户已安装app
### cluster3 redis
- `cache_[reqid]`
- 写入,读取
- 缓存 dsp tracking url
## kafka
- kafka.bj.baidubce.com:9091
- topic: ea6464f767744f6496c1665102a6984c__user_behavior_ad
- 广告tracking数据
- prd 使用分区 0 ~ 29
- 开发阶段测试,使用分区 30
- stg 使用分区 31
......@@ -4,7 +4,6 @@
- 主任务:使用 nginx 代理 http 请求
- 副任务:预测服务超时率每日汇报
- 副任务:dsp 超时报警
- 副任务:dsp 转发 winloss,该功能计划迁移至 2 台 adx-trace
- 副任务:大数据端,拉取 nginx 日志
## 代理 http 请求
......
......@@ -37,6 +37,10 @@
```
## 完整定时任务
- 注意,有一个单独项目 ssp-cron 来整理定时任务。
- 以 ssp-cron 为准,这里仅做参考。
```
/etc/cron.d/monitor
*/5 * * * * root cd /data/appstore/shell/monitor/ && python UserdataServiceMonitor.py >> /var/log/monitor.log 2>&1
......
## 概述
- 提供 ssp 服务器的 stg 环境。
- 主要用于测试,合作伙伴也会用到,所以要保证 stg 正常运行。
- 上线部署 prd。
## 部署
### ssp nginx
- 使用 fabric 部署,
- ssp 代码位置 `/data/appstore/product/appstore-nginx`
- Fabric 部署代码位置:`/data/appstore/deploy/appstore-nginx`
### Thriftc
- 该模块变动较小,且和 ssp 依赖性大,一般不自动化部署。
- 部署步骤
- 各服务器拉取代码后,编译。
- 到 负载均衡 停掉流量,等一分钟后,结束 ssp nginx 进程。
- 拷贝 Thriftc 可执行文件,重启服务。
- 若共享内存结构有变化,则需要停掉 Thriftc 和 ssp nginx 后,删掉旧共享内存。
## valgrind
- 可 yum 安装
### 命令
```
内存泄漏
valgrind --tool=memcheck --leak-check=full ./objs/nginx
```
\ No newline at end of file
......@@ -26,3 +26,8 @@ working_directory core_files;
* soft core unlimited
* hard core unlimited
```
### 内存信息
```
gdb --batch --pid 5664 --ex 'call malloc_stats()'
```
## 技巧
```
进入 root: sudo -i
```
## 细节
### 可执行文件的 PATH
......
3 种 模式:标记模式、脚本模式、数学模式。
2 种 块:
代码块: { let x = 1; x + 2 }
文档内容块 [*Hey* there!]
一个文档内容块产生一个 content 类型的值
开始时处于标记模式,井号 (#) 表示进入脚本模式。
「井号」不属于内容块的语法一部分,而是模式转换的标志。
$sum_x$ 这种是数学模式,一般用不着。
Typst总是倾向于更快地退出脚本模式。
字号:
12pt 点单位,
1em 倍数
使用库查询,比如:
#import "@preview/pointless-size:0.1.0": zh
#zh(1) // 一号 (26pt)
「set」语法
#set text(fill: red)
show 规则
使用 show 规则可以深度定制特定类型文档元素的外观,
最常用的基本形式是 show-set 规则,
以 show 关键字作为开始标记,紧随一个选择器,一个冒号,最后是一个 set 规则。
#show heading: set text(navy)
= This is navy-blue
But this stays black.
「自省函数」是指那些为你获取解释器内部状态的函数。
它们往往接受一些语言对象,而返回存储在解释器内部的相关信息。
repr 接受任意值,而返回对应的代码表示。
函数 type 可以获得任意值的「类型」(type)。
基本字面量
1.「空字面量」 (none literal)。
2.「布尔字面量」 (boolean literal)。
3.「整数字面量」 (integer literal)。
4.「浮点数字面量」(floating-point literal)。
5.「字符串字面量」(string literal)。
类型转换
类型本身也是函数,例如int类型可以接受字符串,转换成整数。
函数声明
#let f(x, y) = [两个值#(x)和#(y)偷偷混入了我们内容之中。]
「闭包」是一类特殊的函数,又称为匿名函数。
#let f = (x, y) => [#(x)和#(y)。]
## 0. 概述
- redis 缓存,需要警惕消费速度低时导致数据堆积。
- 原本做了个 bash 脚本进行检查,之后改为 python: AdxMonitor 的 redis_llen.py
## 1. stg redis
- redis-cnlf9hm5qs56dc7cz.redis.ivolces.com
......
......@@ -6,7 +6,7 @@
* 匹配>=0个重复的在*号之前的字符。
+ 匹配>=1个重复的+号前的字符。
? 标记?之前的字符为可选.
{n,m} 匹配num个大括号之的字符或字符集 (n <= num <= m).
{n,m} 匹配num个大括号之的字符或字符集 (n <= num <= m).
(xyz) 字符集,匹配与 xyz 完全相等的字符串.
| 或运算符,匹配符号前或后的字符.
\ 转义字符,用于匹配一些保留的字符 [ ] ( ) { } . * + ? ^ $ \ |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment